	
(function(){
    var list=document.getElementsByTagName("input");

    var strData="";
    for(var i=0;i<list.length && list[i];i++)
    {
        if(list[i].type=="text"&&list[i].id!="subEmail")
        {
            if(list[i].value < 60){
                E++;
            }else if (list[i].value >= 60 && list[i].value < 70){
                D++;
            }else if (list[i].value >= 70 && list[i].value < 80){
                C++;
            }else if (list[i].value >= 80 && list[i].value < 90){
                B++;
            }else {
                A++;
            }
            // strData +=list[i].id + list[i].value;
        }
    }
    alert(A+" "+B +" " +C +" "+D + " "+E);

	var a = A;
	var b = B;
	var c = C;
	var d = D;
	var e = E;
	//1.实例化对象
	var myChart = echarts.init(document.querySelector(".main"));
	//2.指定配置
	var option = {
    tooltip: {
        trigger: 'item'
    },
    legend: {
        top: '5%',
        left: 'center'
    },
    series: [
        {
            name: '访问来源',
            type: 'pie',
			//内圆 外圆大小
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
			//图形上的文字
            label: {
                show: false,
                position: 'center'
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '40',
                    fontWeight: 'bold'
                }
            },
			//链接文字的线
            labelLine: {
                show: false
            },
			//value是人数
            data: [
                {value: a, name: '搜索引擎'},
                {value: b, name: '直接访问'},
                {value: c, name: '邮件营销'},
                {value: d, name: '联盟广告'},
                {value: e, name: '视频广告'}
            ]
        }
    ]
};
	//3.把配置给实例对象
	myChart.setOption(option);
})()